Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-429] Dungeon Settlement Levels #593

Merged
merged 13 commits into from
May 14, 2024
Merged

Conversation

lotuuu
Copy link
Contributor

@lotuuu lotuuu commented May 10, 2024

Motivation

Adds DungeonSettlementLevels to Users
Closes https://github.com/lambdaclass/champions_of_mirra/issues/429

Summary of changes

  • Creates DungeonSettlementLevel schema
  • Removes kaline_tree_id requirement in user creation
  • Creates message for claiming Dungeon Settlement AFK Rewards
    • Did not create a message for showing these rewards because we will be automatically claiming them everytime we open the Dungeon Settlement screen.
  • Rename most Kalline Tree AFK Rewards messages and funcs because we now have two different AFK Reward groups
  • Add Tests

How to test it?

You can create a user and check that his dungeon_settlement_level is instantiated at level 1.

If you give your user 50 "Blueprints" (using GameBackend.Users.Currencies.add_currency_by_name!/3), you will be able to level up the dungeon settlement of your user with Champions.Users.level_up_dungeon_settlement/1. If you get your user again (Champions.Users.get_user_by_username/1) you will be able to see that his dungeon_settlement_level has increased, and his "Gold" and "Blueprints" currencies decreased!

Since this implements protobuf messages, this PR also adds SocketTester messages! You can also try those :P

@lotuuu lotuuu self-assigned this May 13, 2024
@lotuuu lotuuu marked this pull request as ready for review May 13, 2024 14:07
apps/champions/lib/champions/users.ex Outdated Show resolved Hide resolved
apps/champions/lib/champions/users.ex Outdated Show resolved Hide resolved
apps/champions/lib/champions/users.ex Show resolved Hide resolved
apps/gateway/test/champions_test.exs Outdated Show resolved Hide resolved
apps/serialization/gateway.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@ncontinanza ncontinanza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lotuuu lotuuu added the autobattler AFK Gacha Autobattler game label May 13, 2024

Returns the updated user if the operation was successful.
"""
def level_up_dungeon_settlement(user_id, level_up_costs) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as level_up_kaline_tree? just changing the increment_settlement_levelright?

get_user(user_id)
end

defp increment_settlement_level(user_id) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

@agustinesco agustinesco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! tested and the currencies can be claimed without issues 🪨

@agustinesco agustinesco merged commit 38be6e6 into main May 14, 2024
1 check passed
@agustinesco agustinesco deleted the gh-429-dungeon-settlement-levels branch May 14, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autobattler AFK Gacha Autobattler game
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create DungeonSettlementLevel schema and functionality.
3 participants